// MESI PROTOCOL

#include<stdio.h>

// DECLARE OUTPUT FUNTION POINTER
typedef int(*fpOutput) (int, int); 


// int MemoryRead()

int MemoryRead(char out, int add)
{

	printf("OUTPUT IS %c\n", out);
	printf("CHACHE LINE ADDRESS: %d", add);
	return out;
}

int MemoryWrite(char out, int add)
{
	printf("OUTPUT IS %c\n", out);
	printf("CHACHE LINE ADDRESS: %d", add+10);
	return add;
}

int RFO(char out, int add)
{
	printf("OUTPUT IS %c\n", out);
	printf("CHACHE LINE ADDRESS: %d", add + 10);
	return add;
}

typedef enum statetype_{
	ST_INVALID = 0,
	ST_MODIFIED,
	ST_SHARED,
	ST_EXCLUSIVE,
	ST_MAX

}STATE_TYPE;

typedef enum inputcpu {
	CIN_READ_HIT=0,
	CIN_READ_MISS,
	CIN_WRITE_X,

	CIN_MAX

}CPUINPUT;


typedef enum inputsnoop {
	SIN_READ_HIT = 0,
	SIN_READ_MISS,
	SIN_WRITE_X,

	SIN_MAX

}SNOOPINPUT;


typedef struct state_{

	STATE_TYPE stNext;
	fpOutput MyOutput;
}STATE;


STATE MyMESI[ST_MAX][CIN_MAX][SIN_MAX] = {

	// STATE INVALID
	{
		{ ST_SHARED, MemoryRead },			// CPU READ_HIT
		{ ST_EXCLUSIVE, MemoryRead },		// CPU READ_MISS
		{ ST_MODIFIED, RFO }				// CPU WRITE_X
	},

	{

	},

};

void main()
{



}